package com.apimarket.dao;

import com.apimarket.entity.ApiInterface;
import com.apimarket.entity.ApiInterfaceWithBLOBs;
import com.apimarket.entity.example.ApiInterfaceExample;
import com.apimarket.entity.vo.ApiInterfaceWithBOLOBsPath;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ApiInterfaceMapper {
    long countByExample(ApiInterfaceExample example);

    int deleteByExample(ApiInterfaceExample example);

    int deleteByPrimaryKey(String id);

    int insert(ApiInterfaceWithBLOBs record);

    int insertSelective(ApiInterfaceWithBLOBs record);

    List<ApiInterfaceWithBLOBs> selectByExampleWithBLOBs(ApiInterfaceExample example);

    List<ApiInterface> selectByExample(ApiInterfaceExample example);

    ApiInterfaceWithBLOBs selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") ApiInterfaceWithBLOBs record, @Param("example") ApiInterfaceExample example);

    int updateByExampleWithBLOBs(@Param("record") ApiInterfaceWithBLOBs record, @Param("example") ApiInterfaceExample example);

    int updateByExample(@Param("record") ApiInterface record, @Param("example") ApiInterfaceExample example);

    int updateByPrimaryKeySelective(ApiInterfaceWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(ApiInterfaceWithBLOBs record);

    int updateByPrimaryKey(ApiInterface record);

    void deleteByRouteId(String id);

    List<ApiInterfaceWithBLOBs> selectByOrderId(String id, String name);

    void updateListById(List<ApiInterfaceWithBLOBs> needUpdate);
    @Select("SELECT COUNT(*) FROM api_interface WHERE route_id=#{id}")
    int getRouteChildAPINum(String id);

    void update(ApiInterfaceWithBOLOBsPath record);
    @Delete("delete from api_interface where service_id=#{id}")
    void deleteByServiceId(String id);
}